// Project name:JavaRedis
// Creator:muhong
// Date time:2023/7/24,11:44 上午
// Name:SelectStragy

package org.gmh.channel;


import org.gmh.util.IntSupplier;

/**
 * select策略接口
 *
 * 提供一种能力去空select的行为，比如当有一个事件需要立刻处理的时候，需要跳过或者延迟一个阻塞的block行为
 */
public interface SelectStrategy {

    int SELECT = -1;

    int CONTINUE = -2;

    /**
     * Indicates the IO loop to poll for new events without blocking.
     */
    int BUSY_WAIT = -3;

    int calculateStrategy(IntSupplier selectSupplier, boolean hasTasks) throws Exception;
}
